package com.ly.juc;


import org.junit.jupiter.api.Test;

import java.util.ArrayList;
import java.util.List;
import	java.util.Random;

import java.util.Random;

/**
 * @Classname TestThreadLocal
 * @Description TODO
 * @Date 2020/11/18 11:20
 * @Author 冷心影翼
 */
public class TestThreadLocal {

	ThreadLocal<String> threadLocal = new ThreadLocal<>();



	@Test
	public void T() {
		threadLocal.set("main");
		System.out.println(threadLocal.get());
		new Thread(()->{
			threadLocal.set("1111");
			System.out.println(threadLocal.get());
		}).start();

		while (Thread.activeCount()>2) {

		}
		System.out.println(threadLocal.get());
	}

}
